<include file="../Public/plugin.header.html" />

<link href="__PUBLIC__/Css/plugin-gift.css" rel="stylesheet" type="text/css">

<script type="text/javascript" src="http://api.map.baidu.com/api?v=1.2&services=true"></script>
<script type="text/javascript" src="__PUBLIC__/Js/kim.base.map.js"></script>
<script type="text/javascript">
function getWindowSize(){
	var a,b;
	if(document.documentElement&&document.documentElement.clientWidth)a=document.documentElement.clientWidth;
	else if(document.body)a=document.body.clientWidth;
	if(document.documentElement&&document.documentElement.clientHeight)b=document.documentElement.clientHeight;
	else if(document.body)b=document.body.clientHeight;
	return[a,b];
}
function resize(a,b){
	b = b-50;
	var c=Math.max(a-220,0);
	
	var temp = $("#sidebar").is(":hidden");//是否隐藏
	var temp1= $("#sidebar").is(":visible");//是否可见 
	if(temp||!temp1){
		c=Math.max(a,0);
	}
	$("#sidebar").css( {height: (b+1+"px") } );
	$("#g_plugin").css( {height: (Math.max(b,0)+"px") } );
	$("#map_warp").css( {width: (c+"px") } );
	$("#map_warp").css( {height: (b+"px") } );
	$("#map_container").css( {width: (c+"px") } );
	$("#map_container").css( {height: (b+"px") } );
	$("#FullScreen").css( {top: ((b/2)+"px") } );
	
	//$("#info_list_container").style.height=Math.max(b-161,0)+"px";
	//$("#map_container").style.width=c+"px";
	//$("#map_container").style.height=b+"px";
	//map.changeViewSize(new QQMap.QSize(c,b));adjustListWidth()
}
function resizeFull(){
	var a=getWindowSize();
	//alert(a[0]+"-"+a[1]);
	resize(a[0],a[1]);
}

$(document).ready(function(){
	//alert(1);
	resizeFull();
	window.onload=resizeFull;
	window.onresize=resizeFull;
	k_changeGroupStyle('list_top',' ul > li','{$subitem}','top_bar_on');
	
});

/**隐藏或显示左侧区域**/
function hidesidebar(obj_){
	var rel_ = $(obj_).attr('rel');
	//alert(rel_);
	if(rel_=='show'){
		$(obj_).attr('rel','hide');
		$('#sidebar').hide();
		
		$(obj_).css( { "background-position" : "-34px -250px" } );
		
		$(obj_).attr('title','打开左栏');
		$("#map_warp").css( { left : "0px",width:"100%" } );
		/****/
	}
	if(rel_=='hide'){
		$(obj_).attr('rel','show');
		$('#sidebar').show();
		
		$(obj_).css( { "background-position" : "0px -250px" } );
		
		$(obj_).attr('title','收起左栏');
		$("#map_warp").css( { left : "220px",width:"100%" } );
		/****/
	}
	resizeFull();
}
</script>

<div id="g_plugin_main">
<!--页面主部-->
<div class="p_main" id="p_main">
	<div class="blank10"></div>
	<php>
		$TOP_NAV_BOX_PARAM[]=array('url'=>U('Product://Brand/index'),'desc'=>$_ARY_HRADER_NAV_DICT['BRAND']);
		$TOP_NAV_BOX_PARAM[]=array('desc'=>$brand['title']);
	</php>

	<php>//dump($brand);</php>
	<div class="primary_box" id="topbar" style="border-bottom: 0px dashed #DEDEDE;">
		<!--商品概要信息展示，最右上侧-->
		<ul class="info" style="margin-top: 15px; padding-left: 10px; width: 350px;">
			<!--1. 商品名称-->
			<li class="name"><strong>{$brand['title']}</strong></li>
			<!--4. 小心意价格-->
			<li>简介：{$brand['brief']}
			</li>
		</ul>

		<!--商品图片展示，最左上侧-->
		<div class="pic" style="margin-top: 3px;">
			<!--1. 图片盒，目前共四张，用js来控制显示与否-->
			<div id="pic_box">
				<div style="float: left;">
					<a 	href="#"  class="goods_b" title="{$brand['title']}" >
						<img src="{:getPhotoFromThumb($brand['brand_icon'],300,300)}" alt="{$brand['title']}">	
					</a>
				</div>
			</div>
		</div>
	</div>
	<div class="clear"></div>
	<div class="blank10"></div>
	<div id="list_top" class="list_top">
		<ul >
			<li class="top_bar" rel="goods"
				onclick="k_changeGroupStyle('list_top',' ul > li','goods','top_bar_on');
						$.kajax({      
								url:'{:U('plugin://gift/ajxgoods')}',      
								type:'post',
								data:{ brandid:'{$brand['id']}' } ,    
								async: false ,
								success: function(html){ 
									$('#ajx_show_area').html(html);
								}
						});">商品列表</li>
			
			<li class="top_bar" rel="place"
				onclick="k_changeGroupStyle('list_top',' ul > li','place','top_bar_on');
						$.kajax({      
							url:'{:U('plugin://gift/ajxplace')}',      
							type:'post',
							data:{ brandid:'{$brand['id']}'} ,    
							async: false ,
							success: function(html){ 
								$('#ajx_show_area').html(html);
							}
						});">兑换地点</li>
		</ul>
	</div>
	
	<div id="ajx_show_area" style="width:100%;">
		<php>if($subitem=='goods'){</php>
			<php>//加载的其他页面用到的变量	
				$brandid=$brand['id'];
				$stype='sale';
			</php>
			<include file="../plugin/Tpl/default/gift/goods_list_box.html" />
		<php>}</php>
		<php>if($subitem=='place'){</php>
			<include file="../plugin/Tpl/default/gift/place_list_box.html" />
		<php>}</php>
	</div>
</div>
</div>


<include file="../Public/plugin.footer.html" />